Modify the parameters based on the previous Vivado project according to the schematic:
Schematic:
Vivado parameter modification:
The pins for Ethernet0 are already fixed to the MIO pins on the PS side in the schematic: MIO16~MIO27.
Check MDIO, which is used for Ethernet communication (MDIO (Management Data Input/Output) is an interface protocol for managing Ethernet Physical Layer (PHY) chips). MDIO corresponds to MIO52 and MIO53.
After completing the parameter configuration, click OK. The Block Design (BD) is as follows:
Similarly, perform the subsequent operations to generate a new .xsa file:
Similarly, first update by clicking Update Hardware Specification. Select the .xsa file path. When the following dialog box appears, click OK, which indicates the update was successful.
Modify the platform's BSP file: add the lwip library. Although there are two Board Support Packages, you must modify the one shown below. Modifying the other one will cause an error when creating the application project. Finally, click OK.
After the modification, be sure to right-click the platform project and select Build Project. If you do not rebuild, creating the application project later will also result in an error.
Create the application project. The only difference is selecting the lwIP Echo Server template:
You can modify the IP address as needed (this should be the IP address of the development board).
For example, if the computer's IP is on the 192.168.3 subnet, you must modify the IP address and gateway in the code to be on the same 192.168.3 subnet to allow the server and client to ping each other:
After the project compiles successfully, connect the development board's JTAG to the computer with a Type-C USB cable, and use another Type-C USB cable to connect the board's PS UART to the computer. Connect the board to the computer with an Ethernet cable. On the computer, open a serial terminal tool like MobaXterm and establish a connection with the board's PS UART. After powering on, you can observe through the serial port that the network has started, the IP address is 192.168.3.150, and the service port is 7.
Ping this IP address from the computer. A successful ping indicates that the network connection is established:
After connecting to the development board's server using a network debugging tool on your computer, any data you send to the board will be echoed back. (Set the port number to 7 and use the IP address obtained from the serial port output).